var GraphicalObject = function(type)
{
	this.type = type;
	this.init();
}

GraphicalObject.prototype.init = function()
{
	this.visible = true;
	this.color = "#000000";
	this.alpha = 1;
	this.stateHover = false;
	this.stateSelected = false;
	this.stateDblClickSelected = false;
	this.hColor = "#FFFFFF";
	this.sColor = "#FFFFFF";
	this.dColor = "#FFFFFF";
	this.dblclkColor = "#FFFFFF";
	this.shadowColor = "#FFFFFF";
	this.shadowOffsetX = 0;
	this.shadowOffsetY = 0;
	this.shadowBlur = 0;
	this.z = 0;	// the object with the higher Z has priority when it comes to detection
	this.enabled = true;
	this.drawId = -1;
	this.id = "ndef";
	this.selectable = true;
	this.hoverable = true;
	this.parent = "";
	this.name = "ndef";
	this.buttonType = ButtonType.MainSector;
}

GraphicalObject.prototype.draw = function()
{
	
}

GraphicalObject.prototype.getParent = function()
{
	return this.parent;
}

GraphicalObject.prototype.getDrawId = function()
{
	return this.drawId;
}

GraphicalObject.prototype.getZ = function()
{
	return this.z;
}

GraphicalObject.prototype.setName = function(name)
{
	this.name = name;
}

GraphicalObject.prototype.getName = function()
{
	return this.name;
}

GraphicalObject.prototype.setButtonType = function(t)
{
	this.buttonType = t;
}

GraphicalObject.prototype.setId = function(id)
{
	console.log(id);
	this.id = id;
}

GraphicalObject.prototype.setZ = function(z)
{
	this.z = z;
}

GraphicalObject.prototype.getId = function()
{
	return this.id;
}

GraphicalObject.prototype.getButtonType = function()
{
	return this.buttonType;
}

GraphicalObject.prototype.setHoverable = function(hover)
{
	this.hoverable = hover;
}

GraphicalObject.prototype.setSelectable = function(select)
{
	this.selectable = select;
}

GraphicalObject.prototype.enable = function()
{
	this.enabled = true;
}

GraphicalObject.prototype.disable = function()
{
	this.enabled = false;
}

GraphicalObject.prototype.setEnabled = function(enabled)
{
	this.enabled = enabled;
}

GraphicalObject.prototype.getEnabled = function()
{
	return this.enabled;
}

GraphicalObject.prototype.setParent = function(parent)
{
	this.parent = parent;
}

GraphicalObject.prototype.getSelectable = function()
{
	return this.selectable;
}

GraphicalObject.prototype.getHoverable = function()
{
	return this.hoverable;
}
GraphicalObject.prototype.update = function()
{
}

GraphicalObject.prototype.setAlpha = function(alpha)
{
	this.alpha = alpha;
}

GraphicalObject.prototype.setShadow = function()
{
	ctx.shadowColor = this.shadowColor;
	ctx.shadowOffsetX = this.shadowOffsetX;
	ctx.shadowOffsetY = this.shadowOffsetY;
	ctx.shadowBlur = this.shadowBlur;
	return [color, ox, oy, blur].join(", ");
}

GraphicalObject.prototype.clearShadowAttributes = function()
{
	ctx.shadowColor = "#FFFFFF";
	ctx.shadowOffsetX = 0;
	ctx.shadowOffsetY = 0;
	ctx.shadowBlur = 0;
}

GraphicalObject.prototype.getBounds = function()
{
	return true;
}

GraphicalObject.prototype.getStateSwitch = function(state)
{
	switch(state)
	{
		case ElementState.Hover:
			return this.stateHover;
		break;
		
		case ElementState.Selected:
			return this.stateSelected;
		break;
		
		case ElementState.DblClickSelected:
			return this.stateDblClickSelected;
		break;
	}
}

GraphicalObject.prototype.setStateSwitch = function(state, value)
{
	switch(state)
	{
		case ElementState.Hover:
			this.stateHover = value;
		break;
		
		case ElementState.Selected:
			this.stateSelected = value;
		break;
		
		case ElementState.DblClickSelected:
			this.stateDblClickSelected = value;
		break;
	}
}